<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
  <title>实测数据</title>

  <div th:replace="common :: common_header"></div>
</head>
<body>
<div th:replace="common::#leftmenu"></div>
<div class="main-content">
  <form action="/realdatas" class="form-inline">
    <label for="realDataType">实测数据类型:</label><select id="realDataType" name="realDataType" class="form-control text-center">
    <option th:each="type:${realDataType}"
            th:text="${type}"
            th:value="${type}"
            th:selected="${#strings.equals(param.realDataType, type)}">
    </option>
  </select>
    <button type="submit">搜索</button>
  </form>
  <table class="table table-hover table-striped table-bordered table-sm">
    <thead class="text-center">
    <tr>
      <th>序号</th>
      <th>类型</th>
      <th>名称</th>
      <th>值</th>
      <th>扩展内容</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="realData,stat:${pageInfo.list}" class="text-center">
      <td th:text="${stat.index+(pageInfo.pageNum-1)*pageInfo.pageSize}">id</td>
      <td th:text="${realData.type}">类型</td>
      <td th:text="${realData.name}">名字</td>
      <td th:text="${realData.value}">值</td>
      <td th:text="${realData.extend}">扩展内容</td>
    </tr>
    </tbody>
  </table>
  <div>
    <p>当前第 <span th:text="${pageInfo.pageNum}"></span> 页，总 <span th:text="${pageInfo.pages}"></span> 页，共 <span th:text="${pageInfo.total}"></span> 条记录</p>
    <a th:href="@{/realdatas(realDataType=${param.realDataType}, pageNum=1)}">首页</a>
    <a th:href="@{/realdatas(realDataType=${param.realDataType}, pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a>
    <a th:href="@{/realdatas(realDataType=${param.realDataType}, pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>
    <a th:href="@{/realdatas(realDataType=${param.realDataType}, pageNum=${pageInfo.pages})}">尾页</a>
  </div>
</div>
</body>
</html>